﻿Public Class AuthTypeConverter
    Implements IValueConverter

    Public Function Convert(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        Dim b = CBool(value)
        If b Then
            Return "OAuth"
        Else
            Return "BasicAuth"
        End If
    End Function

    Public Function ConvertBack(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Dim s = value.ToString
        If s = "OAuth" Then
            Return True
        Else
            Return False
        End If
    End Function
End Class
